﻿// ConsoleApplication1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>

#include "ThreadPool.h"
#include "MyLog.h"

void func1111(void* pParam)
{
	spdlog::info("thread_id[{}]:func1111--------", get_curr_tread_id());
}

void func2222()
{
	spdlog::info("thread_id[{}]:func2222--------", get_curr_tread_id());
}

void func3333()
{
	spdlog::info("thread_id[{}]:func3333--------", get_curr_tread_id());
}

int main()
{
	init_log();
	spdlog::info("main_thread_id:[{}]", get_curr_tread_id());
	ctpl::thread_pool p;
	int intValue = 42;
	// 示例调用 schedule 函数
	p.schedule("func1111", std::chrono::seconds(1), func1111, &intValue);
	p.schedule("func2222", std::chrono::seconds(3), func2222);

	::Sleep(5);
	p.schedule("func3333", std::chrono::seconds(2), func3333);

	while (true)
	{
		::Sleep(500);
	}
}
